package com.clothing.customization.controller;

import com.clothing.customization.common.api.Result;
import com.clothing.customization.service.HomeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 首页控制器
 */
@RestController
@RequestMapping("/api/home")
@Tag(name = "首页接口", description = "首页相关接口")
public class HomeController {

    @Autowired
    private HomeService homeService;

    @GetMapping("/stats")
    @Operation(summary = "获取首页统计数据")
    public Result<Map<String, Object>> getHomeStats() {
        return Result.success(homeService.getHomeStats());
    }

    @GetMapping("/recent-orders")
    @Operation(summary = "获取最近订单")
    public Result<?> getRecentOrders() {
        return Result.success(homeService.getRecentOrders());
    }

    @GetMapping("/pending-appointments")
    @Operation(summary = "获取待处理预约")
    public Result<?> getPendingAppointments() {
        return Result.success(homeService.getPendingAppointments());
    }

    @GetMapping("/recommend-designs")
    @Operation(summary = "获取推荐设计")
    public Result<?> getRecommendDesigns() {
        return Result.success(homeService.getRecommendDesigns());
    }

    @GetMapping("/recent-activities")
    @Operation(summary = "获取近期活动")
    public Result<?> getRecentActivities() {
        return Result.success(homeService.getRecentActivities());
    }
} 